package com.shop.product.controller;

import com.shop.common.core.domain.Result;
import com.shop.common.core.web.controller.BaseController;
import com.shop.common.core.web.page.TableDataInfo;
import com.shop.common.security.annotation.RequiresPermissions;
import com.shop.product.domain.MallProductRuleAttrInfo;
import com.shop.product.domain.MallProductRuleInfo;
import com.shop.product.service.MallProductRuleAttrInfoService;
import com.shop.product.service.MallProductRuleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("rule")
public class MallProductRuleAttrInfoController extends BaseController {

    @Autowired
    MallProductRuleAttrInfoService mallProductRuleAttrInfoService;

    /**
     * 查询商品规则列表
     * @param mallProductRuleAttrInfo
     * @return
     */
    @RequiresPermissions("shop:RuleAttrInfo:list")
    @GetMapping("/list")
    public Result<TableDataInfo> list(MallProductRuleAttrInfo mallProductRuleAttrInfo){
        startPage();
        List<MallProductRuleInfo> list =mallProductRuleAttrInfoService.selectMallProductRuleAttrInfoList(mallProductRuleAttrInfo);
        return getDataTable(list);
    }

}
